<div class="row-fluid">
	<div class="span12">
		<div class="operation">
			<form action="<?php echo BASE_URL?>map-management/districts" method="post">
			    <div class="btn-group">
				     <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
						<?php echo ($province_name != "")?$province_name:"ជ្រើសរើសឈ្មោះខេត្ត"; ?>
					<span class="caret"></span>
					</a>
				    <ul id="select-box" class="dropdown-menu">
				   		<?php 
				   		echo ($province_name != "")?"<li><a href='#'>ជ្រើសរើសឈ្មោះខេត្ត</a></li>":"";
							foreach ($provinces as $province){
								echo '<li id="' . $province -> id . '"' . ($province_id == $province -> id?" selected='selected'":'') . '>
			    						<a href="javascript:void(0);">' . $province -> province_name . '</a>
				     				</li>';
							}
						?>
				    </ul>
				    <input type="hidden" name ="cbo-province" value="" class="cbo-hidden-id">
				    <input type="hidden" name ="cbo-province-name" value="" class="cbo-hidden-name">
			    </div>							
			    <div class="input-append">
			    	<input type="search" value="<?php echo isset($str)?$str:""; ?>" name="txt-search" id="appendedInputButton" placeholder="District name">						
					<a href="" class="btn add-on submit"><i class="icon-search"></i> Search</a>
				</div>
				<a href = "<?php echo BASE_URL?>map-management/add-district" class="btn"><i class="icon-plus"></i> Add New</a>
			</form>	
		</div>	
	</div>
</div>
<div class="row-fluid">
	<div class="span12">
		<table class="table table-striped table-bordered table-hover">
		<thead>
			<tr>
				<th>No.</th>
				<th>Province Name</th>
				<th>District Name</th>
				<th>Latitute &amp; Longtitute</th>
				<th>Color</th>
				<th>Created</th>
				<th>Modified</th>
				<th>Option</th>
			</tr>
		</thead>
		<tbody>
			<?php 		
					$i = ($limit_end * $page_number - $limit_end);
					if(count($records)){
						foreach($records as $record){
							$i++;
							echo '
								<tr>
								<td class="">' . $i . '</td>
								<td>' . $record->province_name . '</td>
								<td>' . $record->district_name . '</td>
								<td class=""><div class="ellipsis">' . $record->lat_lon . '</div></td>
								<td class="text-center">' . $record->color . '</td>
								<td class="text-center">' . $record->created . '</td>
								<td class="text-center">' . $record->modified . '</td>
								<td class="text-center">
									<a href="' . getController('url') . 'edit-district/' . $record->id . '">Edit</a> |
									<a href="' . getController('url') . 'delete-district/' . $record->id . '" onclick="if(!confirm(\'Do you want to delete this district [' . $record->district_name . ']?\')) return false;">Delete</a>
								</td>
								</tr>
							';
						}
					}else{
						echo '
							<tr>
								<td colspan="8" align="center" class="text-center">Search not found...</td>
							</tr>
							';
					}
			?>
		</tbody>
		</table>	
	</div>
</div>
<div class="row-fluid">
	<div class="span12">
		<?php echo pagination($page_number,$limit_start,$limit_end,$number_of_rows); ?>
	</div>
</div>